<!--
 * @Author: your name
 * @Date: 2021-07-20 14:21:01
 * @LastEditTime: 2021-09-28 16:33:09
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \usp-osm-frondend\src\views\orderCenter\carWashOrder\details.vue
-->
<template>
  <div
    class="white-content"
    v-loading="pageLoading"
    element-loading-text="loading"
  >
    <div class="newPageTitle">
      <span class="backIcon" @click="goBack"><i class="el-icon-back"></i></span>
      <h1 style="display: inline-block; margin-left: 10px; font-weight: bold">
        洗车订单详情
      </h1>
    </div>
    <div class="detail-content-section">
      <h2>
        <span>洗车订单号：{{ datas.washOrderNo }}</span>
        <span style="float: right">
          订单状态：{{
            getDictionaryNameByCode('ORDERDISPATCHSTATUS', datas.status)
          }}
        </span>
      </h2>
      <el-form label-width="160px" label-position="left">
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="JVID：">
              {{ datas.customerId }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="用户姓名：">
              {{ datas.customerName }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="用户手机号：">
              {{ datas.customerMobile }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车辆识别码：">
              {{ datas.vin }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="服务类型：">
              {{ getDictionaryNameByCode('WASHORDERSERVICETYPE', datas.serviceType)  }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="结算时间：">
              {{ datas.settlementTime | timestampToChange('time') }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="创建时间：">
              {{ datas.createTime | timestampToChange('time') }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="使用时间：">
              {{ datas.usedTime | timestampToChange('time') }}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="detail-content-section">
      <h2>门店信息</h2>
      <el-form label-width="100px" label-position="left">
        <el-row :gutter="40">
          <el-col :span="8">
            <el-form-item label="门店编号：">
              {{ datas.shopCode }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="门店名称：">
              {{ datas.shopName }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="40">
          <el-col :span="8">
            <el-form-item label="省份：">
              {{ datas.province }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="城市：">
              {{ datas.city }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="地区：">
              {{ datas.district }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="详细地址：">
              {{ datas.address }}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
import { setRouterParams, getRouterParams } from '@/utils/auth'
import { common } from '@/mixins/common'
import { mapGetters } from 'vuex'
export default {
  name: 'carWashOrderDetails',
  data () {
    return {
      datas: {
      },
      pageLoading: false,
      id: ''
    }
  },
  mixins: [common],
  computed: {
    ...mapGetters(['lookupItems'])
  },
  mounted () {
    let params = {}
    if (this.$route.params.data) {
      setRouterParams(this.$route)
      params = this.$route.params
    } else {
      params = getRouterParams(this.$route)
    }
    this.datas = params.data
  },
  methods: {
    goBack () {
      this.$router.go(-1)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.footer {
  width: 100%;
  margin: 0;
}
.detail-section {
  h2 {
    margin: 15px 0;
    font-weight: bold;
  }
}
/deep/ .el-form-item {
  margin-bottom: 0;
}
</style>
